package nowcoder.meituan;

import java.util.Arrays;
import java.util.Scanner;

public class TestCode {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int j = 0; j < T; j++){
            int n = sc.nextInt();
            int k = sc.nextInt();
            int[] nums = new int[n];
            for(int i = 0; i < n; i++){
                nums[i] = sc.nextInt();
            }
            Arrays.sort(nums);
            if(k <= n-1 && k > 0){
                if(nums[k] != nums[k-1] && nums[k-1]+1 <= n){
                    System.out.println("YES");
                    System.out.println(nums[k-1]+1);
                }else{
                    System.out.println("NO");
                }
            }else if(k==0){
                if(nums[0] != 1){
                    System.out.println("YES");
                    System.out.println(1);
                }else{
                    System.out.println("NO");
                }
            }else if(k==n){
                if(nums[n-1] < n){
                    System.out.println("YES");
                    System.out.println(nums[n-1]+1);
                }else{
                    System.out.println("NO");
                }
            }
            else{
                System.out.println("NO");
            }
        }


    }
}
